#include<iostream>
#include<queue>
typedef long long ll;
using namespace std;
int main()
{
	ll sum = 0;
	priority_queue<int> tree;
	int n, m;cin >> n >> m;
	for (int i = 1; i <= n; i++)
	{
		int a;cin >> a;sum += a;
		if (a % 2 == 0) tree.push(a);
	}
	while (m--)
	{
		int t = tree.top() / 2;
		sum -= t;
		tree.pop();
		if (t % 2 == 0) tree.push(t);

	}
	cout << sum << endl;
	return 0;
}